<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>模板引擎</title>
</head>

<body>
    <div id='container'></div>
    <!-- http://aui.github.io/art-template/zh-cn/docs/installation.html -->
    <script src="../template-web.js"></script>
    <script type='text/html' id='tpl'>
        <p>{{name}}</p>
        <p>{{age}}</p>
    </script>
    <script>
        var html = template('tpl', {
            name: 'zhangsan',
            age: 18
        });
        document.querySelector('#container').innerHTML = html;
    </script>
</body>

</html>